package wsepForum.common.elements;

import org.compass.annotations.*;

/**
 * 
 * @author Ofir Tam & Ori Ossmy
 *
 */
@Searchable
public class Message extends MessageHeader {

	/*****************************
	 * MEMBERS                   *
	 *****************************/
	/**
	 * 
	 */
	private String body;

	
	
	
	/*****************************
	 * CONSTRUCTOR               *
	 *****************************/	
	protected Message() {
		
	}
	
	/**
	 * 
	 * @param headLine
	 * @param authorUserName
	 * @param body
	 * @param parentID
	 */
	public Message(String headLine, String authorUserName, String body, int parentID) {
		super(headLine, parentID);
		this.authorUserName = authorUserName;
		this.body = body;
	}
	
	
	/**
	 * 
	 * @param headLine
	 * @param authorUserName
	 * @param body
	 */
	public Message(String headLine, String authorUserName, String body) {
		super(headLine, -1);
		this.authorUserName = authorUserName;
		this.body = body;
	}
	
	/*****************************
	 * METHODS                   *
	 *****************************/	
	/**
	 * 
	 * @return
	 */
	@SearchableProperty(name = "contents")
	public String getBody() {
		return this.body;
	}

	
	/**
	 * 
	 * @param body
	 */
	public void setBody(String body) {
		this.body = body;
	}
	
}
